const Mock = require("mockjs");

const signIn = () => ({
  token:
    "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTUzMDMyODY2MywiaWF0IjoxNTI5NzIzODYzfQ.cgmhRgLhy8P0U2l1oLhZqHwlsetp4tUGWjxaDRjHq2uKYOKSveZikhsl_r1drbNQ8lg8ErviShknFVgo-nXg1g"
});

const queryUserAuthority = () => ({
  menus: [
    {
      menuId: 1,
      menuName: "根节点",
      menuCode: "root",
      link: "/root",
      icon: "el-icon-menu",
      lft: 1,
      rgt: 31,
      depth: 0
    },
    // {
    //   menuId: 2,
    //   menuName: "首页",
    //   menuCode: "dashboard",
    //   link: "/dashboard",
    //   icon: "el-icon-menu",
    //   lft: 2,
    //   rgt: 3,
    //   depth: 1
    // },
    {
      menuId: 3,
      menuName: "系统管理",
      menuCode: "system",
      link: "/system",
      icon: "el-icon-menu",
      lft: 4,
      rgt: 9,
      depth: 1
    },
    {
      menuId: 4,
      menuName: "个人设定",
      menuCode: "profile",
      link: "/system/profile",
      icon: "el-icon-menu",
      lft: 5,
      rgt: 6,
      depth: 2
    },
    {
      menuId: 5,
      menuName: "用户管理",
      menuCode: "user",
      link: "/system/user",
      icon: "el-icon-menu",
      lft: 5,
      rgt: 6,
      depth: 2
    },
    {
      menuId: 25,
      menuName: "个人通知",
      menuCode: "notice",
      link: "/system/notice",
      icon: "el-icon-menu",
      lft: 7,
      rgt: 8,
      depth: 2
    }
    ,{
      menuId: 9,
      menuName: "班级管理",
      menuCode: "classManager",
      link: "/classManager",
      icon: "el-icon-menu",
      lft: 11,
      rgt: 9,
      depth: 1
    }
    ,{
      menuId: 10,
      menuName: "成员管理",
      menuCode: "member",
      link: "/member",
      icon: "el-icon-menu",
      lft: 15,
      rgt: 20,
      depth: 1
    }
    ,{
      menuId: 16,
      menuName: "教师管理",
      menuCode: "teacherManager",
      link: "/member/teacherManager",
      icon: "el-icon-menu",
      lft: 16,
      rgt: 17,
      depth: 2
    }
    ,{
      menuId: 17,
      menuName: "学生管理",
      menuCode: "studentManager",
      link: "/member/studentManager",
      icon: "el-icon-menu",
      lft: 18,
      rgt: 19,
      depth: 2
    }
    ,{
      menuId: 11,
      menuName: "考试管理",
      menuCode: "examManager",
      link: "/examManager",
      icon: "el-icon-menu",
      lft: 21,
      rgt: 22,
      depth: 1
    },
    {
      menuId: 12,
      menuName: "试卷管理",
      menuCode: "paper",
      link: "/paper",
      icon: "el-icon-menu",
      lft: 23,
      rgt: 26,
      depth: 1
    },
    {
      menuId: 20,
      menuName: "出卷管理",
      menuCode: "testPaperManager",
      link: "/paper/testPaperManager",
      icon: "el-icon-menu",
      lft: 24,
      rgt: 25,
      depth: 2
    },
    {
      menuId: 21,
      menuName: "批卷管理",
      menuCode: "correctionPaperManager",
      link: "/paper/correctionPaperManager",
      icon: "el-icon-menu",
      lft: 24,
      rgt: 25,
      depth: 2
    },
    {
      menuId: 18,
      menuName: "试题管理",
      menuCode: "testQuestionManager",
      link: "/testQuestionManager",
      icon: "el-icon-menu",
      lft: 28,
      rgt: 29,
      depth: 1
    }
    // ,{
    //   menuId: 13,
    //   menuName: "成绩管理",
    //   menuCode: "scoreManager",
    //   link: "/scoreManager",
    //   icon: "el-icon-menu",
    //   lft: 28,
    //   rgt: 29,
    //   depth: 1
    // }
    // ,{
    //   menuId: 14,
    //   menuName: "在线考试",
    //   menuCode: "goExamination",
    //   link: "/goExamination",
    //   icon: "el-icon-menu",
    //   lft: 28,
    //   rgt: 29,
    //   depth: 1
    // }
  ],
  authorities: [
    { authority_id: 1, authority_code: "AddUser", authority_name: "新增用户" },
    { authority_id: 2, authority_code: "EditUser", authority_name: "修改用户" },
    {
      authority_id: 3,
      authority_code: "DeleteUser",
      authority_name: "删除用户"
    },
    {
      authority_id: 4,
      authority_code: "QueryUser",
      authority_name: "查询用户"
    },
    {
      authority_id: 5,
      authority_code: "QueryReport",
      authority_name: "查询报告"
    }
  ]
});

const queryStudentUserAuthority = () => ({
  menus: [
    {
      menuId: 1,
      menuName: "根节点",
      menuCode: "root",
      link: "/root",
      icon: "el-icon-menu",
      lft: 1,
      rgt: 31,
      depth: 0
    },
    // {
    //   menuId: 2,
    //   menuName: "首页",
    //   menuCode: "dashboard",
    //   link: "/dashboard",
    //   icon: "el-icon-menu",
    //   lft: 2,
    //   rgt: 3,
    //   depth: 1
    // },
    {
      menuId: 3,
      menuName: "系统管理",
      menuCode: "system",
      link: "/system",
      icon: "el-icon-menu",
      lft: 4,
      rgt: 9,
      depth: 1
    },
    {
      menuId: 4,
      menuName: "个人设定",
      menuCode: "profile",
      link: "/system/profile",
      icon: "el-icon-menu",
      lft: 5,
      rgt: 6,
      depth: 2
    },
    // {
    //   menuId: 5,
    //   menuName: "用户管理",
    //   menuCode: "user",
    //   link: "/system/user",
    //   icon: "el-icon-menu",
    //   lft: 5,
    //   rgt: 6,
    //   depth: 2
    // },
    // {
    //   menuId: 6,
    //   menuName: "角色管理",
    //   menuCode: "role",
    //   link: "/system/role",
    //   icon: "el-icon-menu",
    //   lft: 7,
    //   rgt: 8,
    //   depth: 2
    // }
    // ,
    {
      menuId: 25,
      menuName: "个人通知",
      menuCode: "notice",
      link: "/system/notice",
      icon: "el-icon-menu",
      lft: 7,
      rgt: 8,
      depth: 2
    }
    // ,{
    //   menuId: 9,
    //   menuName: "班级管理",
    //   menuCode: "classManager",
    //   link: "/classManager",
    //   icon: "el-icon-menu",
    //   lft: 11,
    //   rgt: 9,
    //   depth: 1
    // }
    // ,{
    //   menuId: 10,
    //   menuName: "成员管理",
    //   menuCode: "member",
    //   link: "/member",
    //   icon: "el-icon-menu",
    //   lft: 15,
    //   rgt: 20,
    //   depth: 1
    // }
    // ,{
    //   menuId: 16,
    //   menuName: "教师管理",
    //   menuCode: "teacherManager",
    //   link: "/member/teacherManager",
    //   icon: "el-icon-menu",
    //   lft: 16,
    //   rgt: 17,
    //   depth: 2
    // }
    // ,{
    //   menuId: 17,
    //   menuName: "学生管理",
    //   menuCode: "studentManager",
    //   link: "/member/studentManager",
    //   icon: "el-icon-menu",
    //   lft: 18,
    //   rgt: 19,
    //   depth: 2
    // }
    // ,{
    //   menuId: 11,
    //   menuName: "考试管理",
    //   menuCode: "examManager",
    //   link: "/examManager",
    //   icon: "el-icon-menu",
    //   lft: 21,
    //   rgt: 22,
    //   depth: 1
    // },{
    //   menuId: 12,
    //   menuName: "试卷管理",
    //   menuCode: "paper",
    //   link: "/paper",
    //   icon: "el-icon-menu",
    //   lft: 23,
    //   rgt: 26,
    //   depth: 1
    // },
    // {
    //   menuId: 20,
    //   menuName: "出卷管理",
    //   menuCode: "testPaperManager",
    //   link: "/paper/testPaperManager",
    //   icon: "el-icon-menu",
    //   lft: 24,
    //   rgt: 25,
    //   depth: 2
    // },
    // {
    //   menuId: 21,
    //   menuName: "批卷管理",
    //   menuCode: "correctionPaperManager",
    //   link: "/paper/correctionPaperManager",
    //   icon: "el-icon-menu",
    //   lft: 24,
    //   rgt: 25,
    //   depth: 2
    // },
    // {
    //   menuId: 18,
    //   menuName: "试题管理",
    //   menuCode: "testQuestionManager",
    //   link: "/testQuestionManager",
    //   icon: "el-icon-menu",
    //   lft: 28,
    //   rgt: 29,
    //   depth: 1
    // }
    ,{
      menuId: 13,
      menuName: "成绩管理",
      menuCode: "scoreManager",
      link: "/scoreManager",
      icon: "el-icon-menu",
      lft: 28,
      rgt: 29,
      depth: 1
    }
    ,{
      menuId: 14,
      menuName: "在线考试",
      menuCode: "goExamination",
      link: "/goExamination",
      icon: "el-icon-menu",
      lft: 28,
      rgt: 29,
      depth: 1
    }
    // ,{
    //   menuId: 15,
    //   menuName: "菜单管理",
    //   menuCode: "menu",
    //   link: "/system/menuManager",
    //   icon: "el-icon-menu",
    //   lft: 5,
    //   rgt: 6,
    //   depth: 2
    // }
  ],
  authorities: [
    { authority_id: 1, authority_code: "AddUser", authority_name: "新增用户" },
    { authority_id: 2, authority_code: "EditUser", authority_name: "修改用户" },
    {
      authority_id: 3,
      authority_code: "DeleteUser",
      authority_name: "删除用户"
    },
    {
      authority_id: 4,
      authority_code: "QueryUser",
      authority_name: "查询用户"
    },
    {
      authority_id: 5,
      authority_code: "QueryReport",
      authority_name: "查询报告"
    }
  ]
});

const queryTeacherUserAuthority = () => ({
  menus: [
    {
      menuId: 1,
      menuName: "根节点",
      menuCode: "root",
      link: "/root",
      icon: "el-icon-menu",
      lft: 1,
      rgt: 31,
      depth: 0
    },
    // {
    //   menuId: 2,
    //   menuName: "首页",
    //   menuCode: "dashboard",
    //   link: "/dashboard",
    //   icon: "el-icon-menu",
    //   lft: 2,
    //   rgt: 3,
    //   depth: 1
    // },
    {
      menuId: 3,
      menuName: "系统管理",
      menuCode: "system",
      link: "/system",
      icon: "el-icon-menu",
      lft: 4,
      rgt: 9,
      depth: 1
    },
    {
      menuId: 4,
      menuName: "个人设定",
      menuCode: "profile",
      link: "/system/profile",
      icon: "el-icon-menu",
      lft: 5,
      rgt: 6,
      depth: 2
    },
    // {
    //   menuId: 5,
    //   menuName: "用户管理",
    //   menuCode: "user",
    //   link: "/system/user",
    //   icon: "el-icon-menu",
    //   lft: 5,
    //   rgt: 6,
    //   depth: 2
    // },
    // {
    //   menuId: 6,
    //   menuName: "角色管理",
    //   menuCode: "role",
    //   link: "/system/role",
    //   icon: "el-icon-menu",
    //   lft: 7,
    //   rgt: 8,
    //   depth: 2
    // }
    // ,
    {
      menuId: 25,
      menuName: "个人通知",
      menuCode: "notice",
      link: "/system/notice",
      icon: "el-icon-menu",
      lft: 7,
      rgt: 8,
      depth: 2
    }
    ,{
      menuId: 9,
      menuName: "班级管理",
      menuCode: "classManager",
      link: "/classManager",
      icon: "el-icon-menu",
      lft: 11,
      rgt: 9,
      depth: 1
    }
    ,{
      menuId: 10,
      menuName: "成员管理",
      menuCode: "member",
      link: "/member",
      icon: "el-icon-menu",
      lft: 15,
      rgt: 20,
      depth: 1
    }
    // ,{
    //   menuId: 16,
    //   menuName: "教师管理",
    //   menuCode: "teacherManager",
    //   link: "/member/teacherManager",
    //   icon: "el-icon-menu",
    //   lft: 16,
    //   rgt: 17,
    //   depth: 2
    // }
    ,{
      menuId: 17,
      menuName: "学生管理",
      menuCode: "studentManager",
      link: "/member/studentManager",
      icon: "el-icon-menu",
      lft: 18,
      rgt: 19,
      depth: 2
    }
    ,{
      menuId: 11,
      menuName: "考试管理",
      menuCode: "examManager",
      link: "/examManager",
      icon: "el-icon-menu",
      lft: 21,
      rgt: 22,
      depth: 1
    },{
      menuId: 12,
      menuName: "试卷管理",
      menuCode: "paper",
      link: "/paper",
      icon: "el-icon-menu",
      lft: 23,
      rgt: 26,
      depth: 1
    },
    {
      menuId: 20,
      menuName: "出卷管理",
      menuCode: "testPaperManager",
      link: "/paper/testPaperManager",
      icon: "el-icon-menu",
      lft: 24,
      rgt: 25,
      depth: 2
    },
    {
      menuId: 21,
      menuName: "批卷管理",
      menuCode: "correctionPaperManager",
      link: "/paper/correctionPaperManager",
      icon: "el-icon-menu",
      lft: 24,
      rgt: 25,
      depth: 2
    },
    {
      menuId: 18,
      menuName: "试题管理",
      menuCode: "testQuestionManager",
      link: "/testQuestionManager",
      icon: "el-icon-menu",
      lft: 28,
      rgt: 29,
      depth: 1
    }
    ,{
      menuId: 13,
      menuName: "成绩管理",
      menuCode: "scoreManager",
      link: "/scoreManager",
      icon: "el-icon-menu",
      lft: 28,
      rgt: 29,
      depth: 1
    }
    // ,{
    //   menuId: 14,
    //   menuName: "在线考试",
    //   menuCode: "goExamination",
    //   link: "/goExamination",
    //   icon: "el-icon-menu",
    //   lft: 28,
    //   rgt: 29,
    //   depth: 1
    // }
    // ,{
    //   menuId: 15,
    //   menuName: "菜单管理",
    //   menuCode: "menu",
    //   link: "/system/menuManager",
    //   icon: "el-icon-menu",
    //   lft: 5,
    //   rgt: 6,
    //   depth: 2
    // }
  ],
  authorities: [
    { authority_id: 1, authority_code: "AddUser", authority_name: "新增用户" },
    { authority_id: 2, authority_code: "EditUser", authority_name: "修改用户" },
    {
      authority_id: 3,
      authority_code: "DeleteUser",
      authority_name: "删除用户"
    },
    {
      authority_id: 4,
      authority_code: "QueryUser",
      authority_name: "查询用户"
    },
    {
      authority_id: 5,
      authority_code: "QueryReport",
      authority_name: "查询报告"
    }
  ]
});

Mock.mock("/passport/signIn", "post", signIn);
Mock.mock("/user/queryUserAuthority", "get", queryUserAuthority);
Mock.mock("/user/queryStudentUserAuthority", "get", queryStudentUserAuthority);
Mock.mock("/user/queryTeacherUserAuthority", "get", queryTeacherUserAuthority);
